Skip to content

Clean up settings#774

Merged
AdrianSosic merged 3 commits into
mainfrom
refactor/settings
May 21, 2026
Merged

Clean up settings#774
AdrianSosic merged 3 commits into
mainfrom
refactor/settings

Conversation

@AdrianSosic

@AdrianSosic AdrianSosic commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

Applies two minor changes:

  • Bumps attrs to latest release. Solves the original problem for the alias workaround, but upgrading surfaced another issue, hence keeping the workaround.
  • Moves the factory function to the global scope (which I noticed is possible while working on the first point) to improve readability

@AdrianSosic AdrianSosic self-assigned this Mar 31, 2026
@AdrianSosic AdrianSosic marked this pull request as ready for review March 31, 2026 11:04
Copilot AI review requested due to automatic review settings March 31, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the project’s settings initialization to take advantage of a newer attrs release, removing a previous workaround around Attribute.alias handling and simplifying the default-factory logic used for environment-driven settings.

Changes:

  • Bump runtime dependency on attrs to >=26.1.0 (and update lockfile accordingly).
  • Refactor the per-field default factory builder into a module-level helper and remove the prior alias fallback workaround.
  • Align deprecation messaging / env-var translation to use fld.alias directly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
uv.lock Locks attrs to 26.1.0 and updates the dev metadata constraint accordingly.
pyproject.toml Raises the minimum supported attrs version to >=26.1.0.
baybe/settings.py Moves the default-factory builder to global scope and relies on Attribute.alias directly for env var naming and deprecation guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Scienfitz Scienfitz added this to the 0.15.0 milestone Apr 1, 2026
@AdrianSosic AdrianSosic added the on hold PR progress is awaiting for something else to continue label Apr 23, 2026
@Scienfitz

Copy link
Copy Markdown
Collaborator

PR currently blocked by external issue
python-attrs/attrs#1540

@Scienfitz Scienfitz modified the milestones: 0.15.0, Roadmap (no ETA) Apr 23, 2026
@AdrianSosic AdrianSosic removed the on hold PR progress is awaiting for something else to continue label May 21, 2026
@AdrianSosic AdrianSosic merged commit 93c1314 into main May 21, 2026
10 of 12 checks passed
@AdrianSosic AdrianSosic deleted the refactor/settings branch May 21, 2026 07:54
@Scienfitz

Copy link
Copy Markdown
Collaborator

@AdrianSosic what happened here? the external issue you said is connected has not changed?

@AdrianSosic

Copy link
Copy Markdown
Collaborator Author

@AdrianSosic what happened here? the external issue you said is connected has not changed?

No, it has not changed, but it is very unclear when it will. So merging the PR now was still valuable, even though it only removed the first blocker for the workaround, since it brought other improvements and was completely functional. So there is simply a TODO note in the code (though now pointing to a different issue than the original one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants